﻿<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
    x:Class="Microsoft.Wpf.Samples.CustomUITwo.MainWindow"
    Title="MainWindow"
    WindowStyle="None" Background="{x:Null}" Foreground="White"
    WindowStartupLocation="CenterScreen"
    AllowsTransparency="True" Height="296" Width="416">
	<Window.Resources>
		<Style x:Key="ButtonFocusVisual">
			<Setter Property="Control.Template">
				<Setter.Value>
					<ControlTemplate>
						<Rectangle Margin="2" SnapsToDevicePixels="true" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<LinearGradientBrush x:Key="ButtonNormalBackground" EndPoint="0,1" StartPoint="0,0">
			<GradientStop Color="#F3F3F3" Offset="0"/>
			<GradientStop Color="#EBEBEB" Offset="0.5"/>
			<GradientStop Color="#DDDDDD" Offset="0.5"/>
			<GradientStop Color="#CDCDCD" Offset="1"/>
		</LinearGradientBrush>
		<SolidColorBrush x:Key="ButtonNormalBorder" Color="#FF707070"/>
		<Style x:Key="CloseButtonStyle" TargetType="{x:Type Button}">
			<Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
			<Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
			<Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/>
			<Setter Property="BorderThickness" Value="1"/>
			<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
			<Setter Property="HorizontalContentAlignment" Value="Center"/>
			<Setter Property="VerticalContentAlignment" Value="Center"/>
			<Setter Property="Padding" Value="1"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Button}">
						<Grid>
							<Grid.RowDefinitions>
								<RowDefinition Height="0.498*"/>
								<RowDefinition Height="0.502*"/>
							</Grid.RowDefinitions>
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualStateGroup.Transitions>
										<VisualTransition GeneratedDuration="0:0:0.4"/>
									</VisualStateGroup.Transitions>
									<VisualState x:Name="Normal"/>
									<VisualState x:Name="MouseOver">
										<Storyboard>
											<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="ellipse">
												<EasingColorKeyFrame KeyTime="0" Value="#FF0030F1"/>
											</ColorAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Pressed">
										<Storyboard>
											<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="ellipse">
												<EasingColorKeyFrame KeyTime="0" Value="#FF350000"/>
											</ColorAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Disabled"/>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Ellipse x:Name="ellipse" Stroke="#FFDE0000" Grid.RowSpan="2">
								<Ellipse.Fill>
									<RadialGradientBrush GradientOrigin="0.496,0.953">
										<GradientStop Color="#FFF10000" Offset="1"/>
										<GradientStop Color="#FFFFD4D4"/>
									</RadialGradientBrush>
								</Ellipse.Fill>
							</Ellipse>
							<Path Data="M74.5,37.5 C74.5,57.934536 58.434536,32 38,32 17.565464,32 0.5,57.934536 0.5,37.5 0.5,17.065464 17.065464,0.5 37.5,0.5 57.934536,0.5 74.5,17.065464 74.5,37.5 z" Stretch="Fill" Stroke="{x:Null}" Margin="0,0,0,-8.462">
								<Path.Fill>
									<LinearGradientBrush EndPoint="0.5,1" MappingMode="RelativeToBoundingBox" StartPoint="0.5,0">
										<GradientStop Color="White"/>
										<GradientStop Offset="1"/>
									</LinearGradientBrush>
								</Path.Fill>
							</Path>
							<ContentPresenter Grid.RowSpan="2" HorizontalAlignment="Center" VerticalAlignment="Center"/>
						</Grid>
						<ControlTemplate.Triggers>
							<Trigger Property="IsKeyboardFocused" Value="true"/>
							<Trigger Property="ToggleButton.IsChecked" Value="true"/>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Foreground" Value="#ADADAD"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<ControlTemplate x:Key="ButtonControlTemplate1" TargetType="{x:Type Button}">
			<Grid Height="43.47" Margin="0,0,8,1.005" Background="{x:Null}">
				<VisualStateManager.VisualStateGroups>
					<VisualStateGroup x:Name="CommonStates">
						<VisualStateGroup.Transitions>
							<VisualTransition GeneratedDuration="0:0:0.2"/>
						</VisualStateGroup.Transitions>
						<VisualState x:Name="Normal"/>
						<VisualState x:Name="MouseOver">
							<Storyboard>
								<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="ellipse">
									<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
								</DoubleAnimationUsingKeyFrames>
							</Storyboard>
						</VisualState>
						<VisualState x:Name="Pressed">
							<Storyboard>
								<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="ellipse">
									<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
								</DoubleAnimationUsingKeyFrames>
								<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Offset)" Storyboard.TargetName="ellipse">
									<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
								</DoubleAnimationUsingKeyFrames>
								<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="ellipse">
									<EasingColorKeyFrame KeyTime="0" Value="#00FF0000"/>
								</ColorAnimationUsingKeyFrames>
							</Storyboard>
						</VisualState>
						<VisualState x:Name="Disabled"/>
					</VisualStateGroup>
				</VisualStateManager.VisualStateGroups>
				<Rectangle Margin="0" RadiusY="4" RadiusX="4" StrokeThickness="1" Stroke="#FF7E7E7E">
					<Rectangle.Fill>
						<LinearGradientBrush EndPoint="0.5,1" MappingMode="RelativeToBoundingBox" StartPoint="0.5,0">
							<GradientStop Color="#004E4E4E" Offset="1"/>
							<GradientStop Color="Black"/>
							<GradientStop Color="#FF666666" Offset="0.492"/>
							<GradientStop Color="#F4000000" Offset="0.512"/>
						</LinearGradientBrush>
					</Rectangle.Fill>
				</Rectangle>
				<ContentPresenter Margin="10,2,10,4" HorizontalAlignment="Center" VerticalAlignment="Center"/>
				<Ellipse x:Name="ellipse" Margin="8,4" StrokeThickness="3" Opacity="0">
					<Ellipse.Fill>
						<RadialGradientBrush>
							<GradientStop Color="#00000000" Offset="1"/>
							<GradientStop Color="Red"/>
						</RadialGradientBrush>
					</Ellipse.Fill>
				</Ellipse>
			</Grid>
		</ControlTemplate>
	</Window.Resources>
    <Grid Margin="0,0,10,10">
		<Grid Margin="0,35,0,0">
			<Grid.Effect>
				<DropShadowEffect/>
			</Grid.Effect>
			<Grid.RowDefinitions>
				<RowDefinition/>
			</Grid.RowDefinitions>

			<Rectangle StrokeThickness="3" Margin="0" RadiusY="12" RadiusX="12">
				<Rectangle.Fill>
					<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
						<GradientStop Color="Black" Offset="0"/>
						<GradientStop Color="#FF3B3B3B" Offset="1"/>
					</LinearGradientBrush>
				</Rectangle.Fill>
			</Rectangle>
			<Grid Margin="0,60,0,0">
				<Grid.RowDefinitions>
					<RowDefinition Height="0.4*"/>
					<RowDefinition Height="0.4*"/>
					<RowDefinition Height="60"/>
				</Grid.RowDefinitions>
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="157.776"/>
					<ColumnDefinition/>
				</Grid.ColumnDefinitions>
				<TextBlock TextWrapping="Wrap" FontSize="29.333" Margin="24,0,3.228,0" VerticalAlignment="Center" Text="User" Foreground="#FFBCBCBC">
					<TextBlock.Effect>
						<DropShadowEffect/>
					</TextBlock.Effect>
				</TextBlock>
				<TextBlock TextWrapping="Wrap" Grid.Row="1" FontSize="29.333" Margin="24,0,0.114,0" VerticalAlignment="Center" Foreground="#FFBCBCBC"><TextBlock.Effect>
						<DropShadowEffect/>
					</TextBlock.Effect><Run Text="Pas"/><Run Text="sword"/></TextBlock>
				<PasswordBox Grid.Column="1" Grid.Row="1" Margin="8" FontSize="32" FontStyle="Italic" BorderThickness="1" SelectionBrush="Red" Password="servus" Background="#BFFFFFFF">
					<PasswordBox.BorderBrush>
						<LinearGradientBrush EndPoint="0,20" MappingMode="Absolute" StartPoint="0,0">
							<GradientStop Color="Black" Offset="0.05"/>
							<GradientStop Color="#FF838383" Offset="0.07"/>
							<GradientStop Color="#FF707070" Offset="1"/>
						</LinearGradientBrush>
					</PasswordBox.BorderBrush>
				</PasswordBox>
				<TextBox TextWrapping="Wrap" Text="Oliver" Grid.Column="1" Margin="8" FontSize="32" FontStyle="Italic" SelectionBrush="Red" BorderThickness="1" Background="#BFFFFFFF">
					<TextBox.BorderBrush>
						<LinearGradientBrush EndPoint="0,20" MappingMode="Absolute" StartPoint="0,0">
							<GradientStop Color="Black" Offset="0.05"/>
							<GradientStop Color="#FF838383" Offset="0.07"/>
							<GradientStop Color="#FF707070" Offset="1"/>
						</LinearGradientBrush>
					</TextBox.BorderBrush>
				</TextBox>
				<StackPanel Grid.Column="1" HorizontalAlignment="Left" Margin="8,0,0,0" Orientation="Horizontal" Grid.Row="2" d:LayoutOverrides="Height">
					<Button 
						x:Name="LoginButton" 
						Content="OK" 
						FontSize="26.667"
						Click="LoginButton_Click" Template="{DynamicResource ButtonControlTemplate1}" Foreground="#FFBCBCBC" Width="120" />
					<Button 
						x:Name="CancelButton" 
						Content="Cancel" 
						FontSize="26.667"
						Click="LoginButton_Click" Template="{DynamicResource ButtonControlTemplate1}" Foreground="#FFBCBCBC" Width="120" />

				</StackPanel>

			</Grid>

		</Grid>
		<Grid HorizontalAlignment="Left" Height="72" VerticalAlignment="Top" Width="208" Margin="48,0,0,0">
			<Rectangle RadiusY="14.5" RadiusX="14.5" Stroke="#FF4B4B4B">
				<Rectangle.Effect>
					<DropShadowEffect/>
				</Rectangle.Effect>
				<Rectangle.Fill>
					<LinearGradientBrush EndPoint="0.43,0.872" StartPoint="0.43,0.059">
						<GradientStop Color="Black" Offset="0"/>
						<GradientStop Color="#FF707070" Offset="1"/>
						<GradientStop Color="#FF686868" Offset="0.512"/>
						<GradientStop Color="Black" Offset="0.541"/>
					</LinearGradientBrush>
				</Rectangle.Fill>
			</Rectangle>
			<TextBlock TextWrapping="Wrap" Margin="0,-0.922,0,9.078" FontSize="48" FontWeight="Bold" d:LayoutOverrides="Height" HorizontalAlignment="Center" Foreground="#FFD2D2D2"><TextBlock.Effect>
					<DropShadowEffect BlurRadius="5"/>
				</TextBlock.Effect><Run Text="Login"/></TextBlock>
		</Grid>
	</Grid>
</Window>
